/**
 * 
 * Copyright (C) 2011 Cody Stoutenburg . All rights reserved.
 *
 *       This program is free software; you can redistribute it and/or
 *       modify it under the terms of the GNU Lesser General Public License
 *       as published by the Free Software Foundation; either version 2.1
 *       of the License, or (at your option) any later version.
 *
 *       This program is distributed in the hope that it will be useful,
 *       but WITHOUT ANY WARRANTY; without even the implied warranty of
 *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *       GNU Lesser General Public License for more details.
 *
 *       You should have received a copy of the GNU Lesser General Public License
 *       along with this program; if not, write to the Free Software
 *       Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
 * 
 */
package ca.usherbrooke.model.damage;

import ca.usherbrooke.tools.Randomizer;

/**
 * this class represent a random damage <br/>
 * 
 * the methods <code>getDamage()</code> will return random damage. <br/>
 * 
 * the damage simulate dices. specify the number of dice and the value of dice <br/>
 * 
 * @author Cody Stoutenburg
 * @version 1.0
 * 
 */
public class RandomDamage implements Damage {
	private static final long serialVersionUID = 1L;

	private final Integer dice;
	private final Integer diceCount;

	/**
	 * create a random damage<br/>
	 * specify the dice of damage to roll when <code>getDamage()</code> is call
	 * 
	 * @param dice
	 *            dice use for damage
	 */
	public RandomDamage(int dice) {
		this(1, dice);
	}

	/**
	 * create a random damage<br/>
	 * specify the dice and the number of dice to roll for damage when
	 * <code>getDamage()</code> is call
	 * 
	 * @param diceCount
	 *            the number of dice to role for damage
	 * @param dice
	 *            dice use for damage
	 */
	public RandomDamage(int diceCount, int dice) {
		super();
		this.diceCount = diceCount;
		this.dice = dice;
	}

	@Override
	public Integer getDamage() {
		return Randomizer.dice(diceCount, dice);
	}

}
